package com.room.reservation.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.room.reservation.mapper.RoomMapper;
import com.room.reservation.domain.Room;
import com.room.reservation.service.IRoomService;

/**
 * 自习室Service业务层处理
 *
 * @author FMBOY
 * @date 2025-10-31
 */
@Service
public class RoomServiceImpl implements IRoomService {
    @Autowired
    private RoomMapper roomMapper;

    /**
     * 查询自习室
     *
     * @param id 自习室主键
     * @return 自习室
     */
    @Override
    public Room selectRoomById(Integer id) {
        return roomMapper.selectRoomById(id);
    }

    /**
     * 查询自习室列表
     *
     * @param room 自习室
     * @return 自习室
     */
    @Override
    public List<Room> selectRoomList(Room room) {
        return roomMapper.selectRoomList(room);
    }

    /**
     * 新增自习室
     *
     * @param room 自习室
     * @return 结果
     */
    @Override
    public int insertRoom(Room room) {
        return roomMapper.insertRoom(room);
    }

    /**
     * 修改自习室
     *
     * @param room 自习室
     * @return 结果
     */
    @Override
    public int updateRoom(Room room) {
        return roomMapper.updateRoom(room);
    }

    /**
     * 批量删除自习室
     *
     * @param ids 需要删除的自习室主键
     * @return 结果
     */
    @Override
    public int deleteRoomByIds(Integer[] ids) {
        return roomMapper.deleteRoomByIds(ids);
    }

    /**
     * 删除自习室信息
     *
     * @param id 自习室主键
     * @return 结果
     */
    @Override
    public int deleteRoomById(Integer id) {
        return roomMapper.deleteRoomById(id);
    }
}
